package com.example.demo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.example.demo.interceptor.SessionInterceptor;


@Configuration
public class LoginSessionConfig extends WebMvcConfigurerAdapter {
	
	
	@Override
    public void addInterceptors(InterceptorRegistry registry) {
		//对来自/user/** 这个链接来的请求进行拦截
        registry.addInterceptor(new SessionInterceptor()).addPathPatterns("/**");
    }
 
}
